﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class ContrastEffectData : EffectOneSourceData

    {
        #region 属性
        private bool _clampSource = false;
        private float _contrast = 0;

        public float Contrast { get => _contrast; set { _contrast = value; OnPropertyChanged();SetIsChanges(); } }
        public bool ClampSource { get => _clampSource; set { _clampSource = value; OnPropertyChanged(); SetIsChanges(); } }
        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
           var source = GetSourceEffect(device, compression);
            if(source == null)
            {
                return null;
            }

            ContrastEffect effect = new ContrastEffect()
            {
                Source = source,
                ClampSource = ClampSource,
                Contrast = Contrast
            };

            return effect;
        }
    }
}
